<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                template="./../template/WorkspaceTemplate.xhtml">

    <ui:define name="top">

    </ui:define>

    <ui:define name="left">

    </ui:define>

    <ui:define name="right">

    </ui:define>

    <ui:define name="content">

        <h2>View Supplier List</h2>
        <h:form id="viewSupplierListForm" style="font-size: 85%">
            <p:panel >
                <br/>
                <p:dataTable var="sr" rowIndexVar="rowIndex" value="#{supplierListManagerBean.supplierListRow}" paginator="true" rows="5">

                    <f:facet name="header">
                        Basic Raw Materials
                    </f:facet>

                    <p:column headerText="Supplier" style="width:15%">  
                        <h:outputText value="#{sr.supplier.supplierName}" />  
                    </p:column>
                    
                    <p:column headerText="Rating" style="width:15%">
                        <h:outputText value="#{sr.supplier.rating}">
                            <f:convertNumber pattern="#0.00"/>
                        </h:outputText>    
                    </p:column>

                    <p:column headerText ="Option" style="width: 2px">
                        <p:commandButton image="ui-icon ui-icon-search" title="View Supplier" action="#{supplierListManagerBean.viewSupplier(sr.supplier.id)}"/>
                        <p:commandButton image="ui-icon ui-icon-pencil" title="Edit Supplier" action="#{supplierListManagerBean.editSupplier(sr.supplier.id)}"/>
                    </p:column>

                    <p:column headerText="OT" style="width: 2px" >
                        <p:graphicImage value="/images/checkIcon.png" width="15" height="15" rendered="#{sr.materialSupplied.get(0)}"/>
                    </p:column>

                    <p:column headerText="WG" style="width: 2px">
                        <p:graphicImage value="/images/checkIcon.png" width="15" height="15" rendered="#{sr.materialSupplied.get(1)}"/>
                    </p:column>

                    <p:column headerText="CM" style="width: 2px">
                        <p:graphicImage value="/images/checkIcon.png" width="15" height="15" rendered="#{sr.materialSupplied.get(2)}"/>
                    </p:column>

                    <p:column headerText="NM" style="width: 2px">
                        <p:graphicImage value="/images/checkIcon.png" width="15" height="15" rendered="#{sr.materialSupplied.get(3)}"/>
                    </p:column>

                    <p:column headerText="CL" style="width: 2px">
                        <p:graphicImage value="/images/checkIcon.png" width="15" height="15" rendered="#{sr.materialSupplied.get(4)}"/>  
                    </p:column>

                    <p:column headerText="HO" style="width: 2px">
                        <p:graphicImage value="/images/checkIcon.png" width="15" height="15" rendered="#{sr.materialSupplied.get(5)}"/>  
                    </p:column>

                    <p:column headerText="CO" style="width: 2px">
                        <p:graphicImage value="/images/checkIcon.png" width="15" height="15" rendered="#{sr.materialSupplied.get(6)}"/>  
                    </p:column>


                </p:dataTable>

                <br/>
                <br/>

                <p:dataTable var="sr" rowIndexVar="rowIndex" value="#{supplierListManagerBean.supplierListRow}" paginator="true" rows="5">

                    <f:facet name="header">
                        Powder Raw Materials
                    </f:facet>

                    <p:column headerText="Supplier" style="width:15%">  
                        <h:outputText value="#{sr.supplier.supplierName}" />  
                    </p:column>
                    
                    <p:column headerText="Rating" style="width:15%">
                        <h:outputText value="#{sr.supplier.rating}">
                            <f:convertNumber pattern="#0.00"/>
                        </h:outputText>    
                    </p:column>

                    <p:column headerText ="Option" style="width: 2px">
                        <p:commandButton image="ui-icon ui-icon-search" title="View Supplier" action="#{supplierListManagerBean.viewSupplier(sr.supplier.id)}"/>
                        <p:commandButton image="ui-icon ui-icon-pencil" title="Edit Supplier" action="#{supplierListManagerBean.editSupplier(sr.supplier.id)}"/>
                    </p:column>

                    <p:column headerText="VM" style="width: 2px">
                        <p:graphicImage value="/images/checkIcon.png" width="15" height="15" rendered="#{sr.materialSupplied.get(7)}"/>  
                    </p:column>

                    <p:column headerText="CC" style="width: 2px">
                        <p:graphicImage value="/images/checkIcon.png" width="15" height="15" rendered="#{sr.materialSupplied.get(8)}"/>  
                    </p:column>
                    z

                    <p:column headerText="PP" style="width: 2px">
                        <p:graphicImage value="/images/checkIcon.png" width="15" height="15" rendered="#{sr.materialSupplied.get(9)}"/>  
                    </p:column>

                    <p:column headerText="CP" style="width: 2px">
                        <p:graphicImage value="/images/checkIcon.png" width="15" height="15" rendered="#{sr.materialSupplied.get(10)}"/>  
                    </p:column>

                    <p:column headerText="HM" style="width: 2px">
                        <p:graphicImage value="/images/checkIcon.png" width="15" height="15" rendered="#{sr.materialSupplied.get(11)}"/>  
                    </p:column>

                </p:dataTable>
                <br/>
                <br/>

                <p:dataTable  var="sr" rowIndexVar="rowIndex" value="#{supplierListManagerBean.supplierListRow}" paginator="true" rows="5">

                    <f:facet name="header">
                        Fruits and Nuts Raw Materials
                    </f:facet>

                    <p:column headerText="Supplier" style="width:15%">  
                        <h:outputText value="#{sr.supplier.supplierName}" />  
                    </p:column>
                    
                    <p:column headerText="Rating" style="width:15%">
                        <h:outputText value="#{sr.supplier.rating}">
                            <f:convertNumber pattern="#0.00"/>
                        </h:outputText>    
                    </p:column>

                    <p:column headerText ="Option" style="width: 2px">
                        <p:commandButton image="ui-icon ui-icon-search" title="View Supplier" action="#{supplierListManagerBean.viewSupplier(sr.supplier.id)}"/>
                        <p:commandButton image="ui-icon ui-icon-pencil" title="Edit Supplier" action="#{supplierListManagerBean.editSupplier(sr.supplier.id)}"/>
                    </p:column>

                    <p:column headerText="CN" style="width: 2px">
                        <p:graphicImage value="/images/checkIcon.png" width="15" height="15" rendered="#{sr.materialSupplied.get(12)}"/>  
                    </p:column>

                    <p:column headerText="WN" style="width: 2px">
                        <p:graphicImage value="/images/checkIcon.png" width="15" height="15" rendered="#{sr.materialSupplied.get(13)}"/>  
                    </p:column>

                    <p:column headerText="AL" style="width: 2px">
                        <p:graphicImage value="/images/checkIcon.png" width="15" height="15" rendered="#{sr.materialSupplied.get(14)}"/>  
                    </p:column>

                    <p:column headerText="MD" style="width: 2px">
                        <p:graphicImage value="/images/checkIcon.png" width="15" height="15" rendered="#{sr.materialSupplied.get(15)}"/>  
                    </p:column>

                    <p:column headerText="RD" style="width: 2px">
                        <p:graphicImage value="/images/checkIcon.png" width="15" height="15" rendered="#{sr.materialSupplied.get(16)}"/>  
                    </p:column>

                    <p:column headerText="RS" style="width: 2px">
                        <p:graphicImage value="/images/checkIcon.png" width="15" height="15" rendered="#{sr.materialSupplied.get(17)}"/>  
                    </p:column>

                    <p:column headerText="DT" style="width: 2px">
                        <p:graphicImage value="/images/checkIcon.png" width="15" height="15" rendered="#{sr.materialSupplied.get(18)}"/>  
                    </p:column>

                    <p:column headerText="AR" style="width: 2px">
                        <p:graphicImage value="/images/checkIcon.png" width="15" height="15" rendered="#{sr.materialSupplied.get(19)}"/>  
                    </p:column>

                    <p:column headerText="KW" style="width: 2px">
                        <p:graphicImage value="/images/checkIcon.png" width="15" height="15" rendered="#{sr.materialSupplied.get(20)}"/>  
                    </p:column>

                    <p:column headerText="AP" style="width: 2px">
                        <p:graphicImage value="/images/checkIcon.png" width="15" height="15" rendered="#{sr.materialSupplied.get(21)}"/>  
                    </p:column>

                    <p:column headerText="PE" style="width: 2px">
                        <p:graphicImage value="/images/checkIcon.png" width="15" height="15" rendered="#{sr.materialSupplied.get(22)}"/>  
                    </p:column>

                </p:dataTable>

                <br/>
                <br/>
                <br/>

                <h:panelGrid columns="1" style="font-size: 85%; border-style: solid; border-width: thin; width: 100%; padding: 10px" >

                    <h:outputText value="Legend" style="font-weight: bold; font-size: 110%"/>
                    <p:separator/>
                    <h:panelGrid columns="5" cellpadding="0 20" style="width: 100%">
                        <h:outputText value="OT - Oats" />
                        <h:outputText value="WG - Wheat Germ" />
                        <h:outputText value="CM - Cinnamon" />
                        <h:outputText value="NM - Nutmeg" />
                        <h:outputText value="CL - Cloves" />
                        <h:outputText value="HO - Honey" />
                        <h:outputText value="CO - Canola Oil" />
                        <h:outputText value="VM - Vitamin / Mineral Powder" />
                        <h:outputText value="CC - Carob Chips" />
                        <h:outputText value="PP - Protein Powder" />
                        <h:outputText value="CP - Cocoa Powder" />
                        <h:outputText value="HN - Hazenuts" />
                        <h:outputText value="CN - Cashew Nuts" />
                        <h:outputText value="WN - Walnuts" />
                        <h:outputText value="AL - Almonds" />
                        <h:outputText value="MD - Macadamias" />
                        <h:outputText value="RC - Redcurrants" />
                        <h:outputText value="RS - Rasins" />
                        <h:outputText value="DT - Dates" />
                        <h:outputText value="AR - Apricots" />
                        <h:outputText value="KW - Kiwis" />
                        <h:outputText value="AP - Apples" />
                        <h:outputText value="PE - Peaches" />
                    </h:panelGrid>
                </h:panelGrid>
                <br/>
            </p:panel>
            <br/>
            <br/>
            <br/>
        </h:form>


    </ui:define>

    <ui:define name="bottom">

    </ui:define>

</ui:composition>
